home *** CD-ROM | disk | FTP | other *** search
/ Amiga Developer CD 2.1 / Amiga Developer CD v2.1.iso / NDK / NDK_3.1 / Examples1 / locale / helloworld / helloworld.c < prev    next >
Encoding:
C/C++ Source or Header  |  1999-10-27  |  1.4 KB  |  56 lines

  1. /*
  2. COPYRIGHT: Unless otherwise noted, all files are Copyright (c) 1992-1999
  3. Amiga, Inc.  All rights reserved.
  4.  
  5. DISCLAIMER: This software is provided "as is".  No representations or
  6. warranties are made with respect to the accuracy, reliability, performance,
  7. currentness, or operation of this software, and all use is at your own risk.
  8. Neither Amiga nor the authors assume any responsibility or liability
  9. whatsoever with respect to your use of this software.
  10. */
  11.  
  12. #include <exec/types.h>
  13. #include <libraries/locale.h>
  14. #include <stdio.h>
  15. #include <dos.h>
  16.  
  17. #include <clib/exec_protos.h>
  18. #include <clib/locale_protos.h>
  19.  
  20. #include <pragmas/exec_pragmas.h>
  21. #include <pragmas/locale_pragmas.h>
  22.  
  23. #define CATCOMP_NUMBERS
  24. #include "helloworld_strings.h"
  25.  
  26.  
  27. extern struct Library *SysBase;
  28. extern struct Library *DOSBase;
  29. struct Library *LocaleBase;
  30.  
  31.  
  32. STRPTR __asm GetString(register __a0 struct LocaleInfo *li,
  33.                        register __d0 LONG stringNum);
  34.  
  35.  
  36. VOID main(VOID)
  37. {
  38. struct LocaleInfo li;
  39.  
  40.     li.li_Catalog = NULL;
  41.     if (LocaleBase = OpenLibrary("locale.library",38))
  42.     {
  43.         li.li_LocaleBase = LocaleBase;
  44.         li.li_Catalog    = OpenCatalogA(NULL,"helloworld.catalog",NULL);
  45.     }
  46.  
  47.     printf("%s\n",GetString(&li,MSG_HELLO));
  48.     printf("%s\n",GetString(&li,MSG_BYE));
  49.  
  50.     if (LocaleBase)
  51.     {
  52.         CloseCatalog(li.li_Catalog);
  53.         CloseLibrary(LocaleBase);
  54.     }
  55. }
  56.